//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.batch;

import java.io.Serializable;
import java.math.BigDecimal;

public class Batch
        implements Serializable {

    public Batch() {
    }

    public Batch(Integer id, String buyId, String palletGTIN, String dateDLUO, BigDecimal inputStockQuantity, BigDecimal stockQuantity, String boxGTIN,
            String itemGTIN, String itemId, String deliveryForm, Integer agencyId, String itemBatch, String supplierGLN, String supplierId,
            String inputStockDate, String inventoryDate, String dateDLC, Integer status, BigDecimal packaging, BigDecimal batchPrice, String notes,
            String unit, BigDecimal deltaInventory, String sscc, String truckingCompagny, String updateLastTime, String userId) {
        setId(id);
        setBuyId(buyId);
        setPalletGTIN(palletGTIN);
        setDateDLUO(dateDLUO);
        setInputStockQuantity(inputStockQuantity);
        setStockQuantity(stockQuantity);
        setBoxGTIN(boxGTIN);
        setItemGTIN(itemGTIN);
        setItemId(itemId);
        setDeliveryForm(deliveryForm);
        setAgencyId(agencyId);
        setItemBatch(itemBatch);
        setSupplierGLN(supplierGLN);
        setSupplierId(supplierId);
        setInputStockDate(inputStockDate);
        setInventoryDate(inventoryDate);
        setDateDLC(dateDLC);
        setStatus(status);
        setPackaging(packaging);
        setBatchPrice(batchPrice);
        setNotes(notes);
        setUnit(unit);
        setDeltaInventory(deltaInventory);
        setSscc(sscc);
        setTruckingCompagny(truckingCompagny);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
    }

    public Batch(Batch batch) {
        setId(batch.getId());
        setBuyId(batch.getBuyId());
        setPalletGTIN(batch.getPalletGTIN());
        setDateDLUO(batch.getDateDLUO());
        setInputStockQuantity(batch.getInputStockQuantity());
        setStockQuantity(batch.getStockQuantity());
        setBoxGTIN(batch.getBoxGTIN());
        setItemGTIN(batch.getItemGTIN());
        setItemId(batch.getItemId());
        setDeliveryForm(batch.getDeliveryForm());
        setAgencyId(batch.getAgencyId());
        setItemBatch(batch.getItemBatch());
        setSupplierGLN(batch.getSupplierGLN());
        setSupplierId(batch.getSupplierId());
        setInputStockDate(batch.getInputStockDate());
        setInventoryDate(batch.getInventoryDate());
        setDateDLC(batch.getDateDLC());
        setStatus(batch.getStatus());
        setPackaging(batch.getPackaging());
        setBatchPrice(batch.getBatchPrice());
        setNotes(batch.getNotes());
        setUnit(batch.getUnit());
        setDeltaInventory(batch.getDeltaInventory());
        setSscc(batch.getSscc());
        setTruckingCompagny(batch.getTruckingCompagny());
        setUpdateLastTime(batch.getUpdateLastTime());
        setUserId(batch.getUserId());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getBuyId() {
        return buyId;
    }

    public void setBuyId(String buyId) {
        this.buyId = buyId;
    }

    public String getPalletGTIN() {
        return palletGTIN;
    }

    public void setPalletGTIN(String palletGTIN) {
        this.palletGTIN = palletGTIN;
    }

    public String getDateDLUO() {
        return dateDLUO;
    }

    public void setDateDLUO(String dateDLUO) {
        this.dateDLUO = dateDLUO;
    }

    public BigDecimal getInputStockQuantity() {
        return inputStockQuantity;
    }

    public void setInputStockQuantity(BigDecimal inputStockQuantity) {
        this.inputStockQuantity = inputStockQuantity;
    }

    public BigDecimal getStockQuantity() {
        return stockQuantity;
    }

    public void setStockQuantity(BigDecimal stockQuantity) {
        this.stockQuantity = stockQuantity;
    }

    public String getBoxGTIN() {
        return boxGTIN;
    }

    public void setBoxGTIN(String boxGTIN) {
        this.boxGTIN = boxGTIN;
    }

    public String getItemGTIN() {
        return itemGTIN;
    }

    public void setItemGTIN(String itemGTIN) {
        this.itemGTIN = itemGTIN;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getItemBatch() {
        return itemBatch;
    }

    public void setItemBatch(String itemBatch) {
        this.itemBatch = itemBatch;
    }

    public String getDeliveryForm() {
        return deliveryForm;
    }

    public void setDeliveryForm(String deliveryForm) {
        this.deliveryForm = deliveryForm;
    }

    public String getSupplierGLN() {
        return supplierGLN;
    }

    public void setSupplierGLN(String supplierGLN) {
        this.supplierGLN = supplierGLN;
    }

    public Integer getAgencyId() {
        return agencyId;
    }

    public void setAgencyId(Integer agencyId) {
        this.agencyId = agencyId;
    }

    public String getDateDLC() {
        return dateDLC;
    }

    public void setDateDLC(String dateDLC) {
        this.dateDLC = dateDLC;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public BigDecimal getPackaging() {
        return packaging;
    }

    public void setPackaging(BigDecimal packaging) {
        this.packaging = packaging;
    }

    public BigDecimal getBatchPrice() {
        return batchPrice;
    }

    public void setBatchPrice(BigDecimal batchPrice) {
        this.batchPrice = batchPrice;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public BigDecimal getDeltaInventory() {
        return deltaInventory;
    }

    public void setDeltaInventory(BigDecimal deltaInventory) {
        this.deltaInventory = deltaInventory;
    }

    public String getSscc() {
        return sscc;
    }

    public void setSscc(String sscc) {
        this.sscc = sscc;
    }

    public String getTruckingCompagny() {
        return truckingCompagny;
    }

    public void setTruckingCompagny(String truckingCompagny) {
        this.truckingCompagny = truckingCompagny;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getInventoryDate() {
        return inventoryDate;
    }

    public void setInventoryDate(String inventoryDate) {
        this.inventoryDate = inventoryDate;
    }

    public String getInputStockDate() {
        return inputStockDate;
    }

    public void setInputStockDate(String inputStockDate) {
        this.inputStockDate = inputStockDate;
    }

    public String getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "buyId=" + getBuyId() + " " + "palletGTIN=" + getPalletGTIN() + " " + "dateDLUO=" + getDateDLUO() + " " + "inputStockQuantity=" + getInputStockQuantity() + " " + "stockQuantity=" + getStockQuantity() + " " + "boxGTIN=" + getBoxGTIN() + " " + "itemGTIN=" + getItemGTIN() + " " + "itemId=" + getItemId() + " " + "deliveryForm=" + getDeliveryForm() + " " + "agencyId=" + getAgencyId() + " " + "itemBatch=" + getItemBatch() + " " + "supplierGLN=" + getSupplierGLN() + " " + "supplierId=" + getSupplierId() + " " + "inputStockDate=" + getInputStockDate() + " " + "inventoryDate=" + getInventoryDate() + " " + "dateDLC=" + getDateDLC() + " " + "status=" + getStatus() + " " + "packaging=" + getPackaging() + " " + "batchPrice=" + getBatchPrice() + " " + "notes=" + getNotes() + " " + "unit=" + getUnit() + " " + "deltaInventory=" + getDeltaInventory() + " " + "designation=" + getSscc() + " " + "truckingCompagny=" + getTruckingCompagny() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "userId=" + getUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof Batch) {
            Batch lTest = (Batch) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (buyId == null) {
                lEquals = lEquals && lTest.buyId == null;
            } else {
                lEquals = lEquals && buyId.equals(lTest.buyId);
            }
            if (palletGTIN == null) {
                lEquals = lEquals && lTest.palletGTIN == null;
            } else {
                lEquals = lEquals && palletGTIN.equals(lTest.palletGTIN);
            }
            if (dateDLUO == null) {
                lEquals = lEquals && lTest.dateDLUO == null;
            } else {
                lEquals = lEquals && dateDLUO.equals(lTest.dateDLUO);
            }
            if (inputStockQuantity == null) {
                lEquals = lEquals && lTest.inputStockQuantity == null;
            } else {
                lEquals = lEquals && inputStockQuantity.equals(lTest.inputStockQuantity);
            }
            if (stockQuantity == null) {
                lEquals = lEquals && lTest.stockQuantity == null;
            } else {
                lEquals = lEquals && stockQuantity.equals(lTest.stockQuantity);
            }
            if (boxGTIN == null) {
                lEquals = lEquals && lTest.boxGTIN == null;
            } else {
                lEquals = lEquals && boxGTIN.equals(lTest.boxGTIN);
            }
            if (itemGTIN == null) {
                lEquals = lEquals && lTest.itemGTIN == null;
            } else {
                lEquals = lEquals && itemGTIN.equals(lTest.itemGTIN);
            }
            if (itemId == null) {
                lEquals = lEquals && lTest.itemId == null;
            } else {
                lEquals = lEquals && itemId.equals(lTest.itemId);
            }
            if (deliveryForm == null) {
                lEquals = lEquals && lTest.deliveryForm == null;
            } else {
                lEquals = lEquals && deliveryForm.equals(lTest.deliveryForm);
            }
            if (agencyId == null) {
                lEquals = lEquals && lTest.agencyId == null;
            } else {
                lEquals = lEquals && agencyId.equals(lTest.agencyId);
            }
            if (itemBatch == null) {
                lEquals = lEquals && lTest.itemBatch == null;
            } else {
                lEquals = lEquals && itemBatch.equals(lTest.itemBatch);
            }
            if (supplierGLN == null) {
                lEquals = lEquals && lTest.supplierGLN == null;
            } else {
                lEquals = lEquals && supplierGLN.equals(lTest.supplierGLN);
            }
            if (supplierId == null) {
                lEquals = lEquals && lTest.supplierId == null;
            } else {
                lEquals = lEquals && supplierId.equals(lTest.supplierId);
            }
            if (dateDLC == null) {
                lEquals = lEquals && lTest.dateDLC == null;
            } else {
                lEquals = lEquals && dateDLC.equals(lTest.dateDLC);
            }
            if (status == null) {
                lEquals = lEquals && lTest.status == null;
            } else {
                lEquals = lEquals && status.equals(lTest.status);
            }
            if (packaging == null) {
                lEquals = lEquals && lTest.packaging == null;
            } else {
                lEquals = lEquals && packaging.equals(lTest.packaging);
            }
            if (batchPrice == null) {
                lEquals = lEquals && lTest.batchPrice == null;
            } else {
                lEquals = lEquals && batchPrice.equals(lTest.batchPrice);
            }
            if (notes == null) {
                lEquals = lEquals && lTest.notes == null;
            } else {
                lEquals = lEquals && notes.equals(lTest.notes);
            }
            if (unit == null) {
                lEquals = lEquals && lTest.unit == null;
            } else {
                lEquals = lEquals && unit.equals(lTest.unit);
            }
            if (deltaInventory == null) {
                lEquals = lEquals && lTest.deltaInventory == null;
            } else {
                lEquals = lEquals && deltaInventory.equals(lTest.deltaInventory);
            }
            if (sscc == null) {
                lEquals = lEquals && lTest.sscc == null;
            } else {
                lEquals = lEquals && sscc.equals(lTest.sscc);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            if (inputStockDate == null) {
                lEquals = lEquals && lTest.inputStockDate == null;
            } else {
                lEquals = lEquals && inputStockDate.equals(lTest.inputStockDate);
            }
            if (inventoryDate == null) {
                lEquals = lEquals && lTest.inventoryDate == null;
            } else {
                lEquals = lEquals && inventoryDate.equals(lTest.inventoryDate);
            }
            if (truckingCompagny == null) {
                lEquals = lEquals && lTest.truckingCompagny == null;
            } else {
                lEquals = lEquals && truckingCompagny.equals(lTest.truckingCompagny);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (buyId == null ? 0 : buyId.hashCode());
        result = 37 * result + (palletGTIN == null ? 0 : palletGTIN.hashCode());
        result = 37 * result + (dateDLUO == null ? 0 : dateDLUO.hashCode());
        result = 37 * result + (inputStockQuantity == null ? 0 : inputStockQuantity.hashCode());
        result = 37 * result + (stockQuantity == null ? 0 : stockQuantity.hashCode());
        result = 37 * result + (boxGTIN == null ? 0 : boxGTIN.hashCode());
        result = 37 * result + (itemGTIN == null ? 0 : itemGTIN.hashCode());
        result = 37 * result + (itemId == null ? 0 : itemId.hashCode());
        result = 37 * result + (deliveryForm == null ? 0 : deliveryForm.hashCode());
        result = 37 * result + (agencyId == null ? 0 : agencyId.hashCode());
        result = 37 * result + (itemBatch == null ? 0 : itemBatch.hashCode());
        result = 37 * result + (supplierGLN == null ? 0 : supplierGLN.hashCode());
        result = 37 * result + (supplierId == null ? 0 : supplierId.hashCode());
        result = 37 * result + (dateDLC == null ? 0 : dateDLC.hashCode());
        result = 37 * result + (status == null ? 0 : status.hashCode());
        result = 37 * result + (packaging == null ? 0 : packaging.hashCode());
        result = 37 * result + (batchPrice == null ? 0 : batchPrice.hashCode());
        result = 37 * result + (notes == null ? 0 : notes.hashCode());
        result = 37 * result + (unit == null ? 0 : unit.hashCode());
        result = 37 * result + (deltaInventory == null ? 0 : deltaInventory.hashCode());
        result = 37 * result + (sscc == null ? 0 : sscc.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        result = 37 * result + (inputStockDate == null ? 0 : inputStockDate.hashCode());
        result = 37 * result + (inventoryDate == null ? 0 : inventoryDate.hashCode());
        result = 37 * result + (truckingCompagny == null ? 0 : truckingCompagny.hashCode());
        return result;
    }
    private Integer id;
    private String buyId;
    private String sscc;
    private String palletGTIN;
    private String boxGTIN;
    private String itemGTIN;
    private String itemId;
    private String itemBatch;
    private String deliveryForm;
    private String supplierGLN;
    private String supplierId;
    private Integer agencyId;
    private String inputStockDate;
    private String inventoryDate;
    private String dateDLC;
    private String dateDLUO;
    private BigDecimal inputStockQuantity;
    private BigDecimal stockQuantity;
    private BigDecimal deltaInventory;
    private BigDecimal packaging;
    private String unit;
    private BigDecimal batchPrice;
    private Integer status;
    private String notes;
    private String updateLastTime;
    private String userId;
    private String truckingCompagny;
}
